package com.ys.day30.p4XML解析与配置;

import java.util.Objects;

/**
 * 描述: TODO
 *
 * @author CodeYang
 * @version 2021/1/14 15:55
 */
public class SocketBean {

    private  String address;
    private int port;

    public SocketBean() {
    }

    public SocketBean(String address, int port) {
        this.address = address;
        this.port = port;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SocketBean that = (SocketBean) o;
        return port == that.port &&
                Objects.equals(address, that.address);
    }

    @Override
    public int hashCode() {
        return Objects.hash(address, port);
    }

    @Override
    public String
    toString() {
        return "SocketBean{" +
                "address='" + address + '\'' +
                ", port=" + port +
                '}';
    }
}
